package com.bruce.codeFactory.Thread.designMode.Balking;

/**
 * @author luotuan
 * @Description
 * @create 2019-03-07 22:04
 **/
public class SaveThread extends Thread {
    private FileData fileData;

    public SaveThread(String name, FileData fileData) {
        super(name);
        this.fileData = fileData;
    }

    @Override
    public void run() {
        try {
            while (true){
                fileData.save();
                Thread.sleep(1000);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
